/**
 * 获取随机id
 * asdf
 */
function s4() {
  return Math.trunc((1 + Math.random()) * 0x10000)
    .toString(16)
    .slice(1)
}
/**
 * 获取随机id
 * asdf-123d-gf5e-e12d
 */
export function guid() {
  return `${s4()}-${s4()}-${s4()}-${s4()}`
}
/**
 * @description 混淆value char(1)
 */
export function compile(value: string) {
  const compiledValue = value + guid().slice(1)
  return compiledValue
}
/**
 * @description 解译value char(1)
 */
export function decode(compiledValue: string) {
  return compiledValue.slice(0, 1)
}
